package com.quanyan.financialSystem.web.place;


import com.quanyan.api.APIResponse;
import com.quanyan.financialSystem.entity.vo.place.resp.ProfitLossInfoVo;
import com.quanyan.financialSystem.entity.vo.req.ReqPlaceRentCost;
import com.quanyan.financialSystem.service.place.PlaceRentCostService;
import com.quanyan.financialSystem.service.place.ProfitLossReportFormService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author chun-tu
 * @email 2539466234@qq.com
 * @date 2016/10/15.
 */
@RestController
@RequestMapping(value = "/admin/api/financial/place")
public class PlaceRentCostController {

    private static final Logger logger = LoggerFactory.getLogger(PlaceRentCostController.class);
    @Autowired
    private PlaceRentCostService placeRentCostService;

    @RequestMapping(value = "/rentCost", method = RequestMethod.POST)
    public APIResponse profitLossStatement(@RequestBody ReqPlaceRentCost reqPlaceRentCost) {
        try {
            return placeRentCostService.findPlaceRentCost(reqPlaceRentCost);
        }catch (Exception e){
            logger.error("{}",e);
            return  APIResponse.returnFail("系统异常");
        }
    }

}
